$(document).ready(function(){	
	var offNaviObj = $(".pageNavi").find(".numberingOff");
	
	$(offNaviObj).each(function(idx, item){
		$(item).mouseenter(function() {
			$(item).removeClass().addClass("numberingOn-temp");		
		}).mouseleave(function(){
			$(item).removeClass().addClass("numberingOff");
		});
		
		$(item).on("click", naviNumClick);
	});
});

function naviNumClickEventReg(obj){
	$(obj).on("click", naviNumClick);
};

function naviNumClick(){
	var opts = new Object();
	opts["url"] = $("#loadPageNaviUrl").text()+"/"+$(this).text();
	opts["dataType"] = "html";
	opts["type"] = "POST";
	opts["data"] = ($.trim($("#frmPageNaviData").text()) != "") ? "frm:"+$("#frmPageNaviData").text() : "";
	opts["htmlDiv"] = $("#htmlPageNaviDiv").text();
	
	loadPageNavi(opts);
}

var loadPageNavi = function (opts) {
	var ajax = new jqMyAjax();
	var data = opts["data"];
	var htmlDiv = opts["htmlDiv"];
	var option = new Object();
	option["url"] = opts["url"];
	option["dataType"] = opts["dataType"];
	option["type"] = opts["type"];
	option["data"] = (data != null && data.indexOf("frm:") != -1)? $("#"+data.split("frm:")[1]).serialize() : data;
	option["success"] = function(data){
		$(htmlDiv).html(data);
	};
	option["error"] = function(xhr, status, thrown){
		var extraMsg = "";
		var sessionOutRedirect = true;
		ajax.errorCalback(xhr, extraMsg, sessionOutRedirect);
		
		var style = "style='font-weight:bold; font-size:14pt;'";
		$(htmlDiv).html("<font "+style+">HTTP STATUS "+xhr.status + "  " + status.toUpperCase()+"</font>");
	};
	
	ajax.callAjax(option);
};